<?php
/**
 * Created by PhpStorm.
 * User: Kiriti
 * Date: 2016/4/1 0001
 * Time: 14:57
 */

namespace app\controllers;

use app\models\Pr_project;
use yii\web\Controller;
use Yii;
use app\models\Rs_raised;
use app\models\Uc_user;


class PrlaunchController extends Controller{
	
//    public $layout=false;
    public function actionShow(){

		if(!empty($_COOKIE['user_id'])){

			$user_id = $_COOKIE['user_id'];
			$user = Uc_user::find()
				->where([
					'user_id' => $user_id, //user_id => user_id
					'del_flag' => 0
				])
				->one();

			$view = Yii::$app->view;
			$view->params['title'] = "发起项目";
			PrlikeController::setView($user);
			
			$query = Rs_raised::find()->where([
				'user_id' => $user_id,
				'del_flag' => 0
			])->all();

			$query2 = Pr_project::find()->where([
				'user_id' => $user_id,
				'del_flag' => 0
			])->all();


			return $this->render('prlaunch.php', ['prLaunch'=>$query, 'prLaunch2'=>$query2]);

		}else{
			echo "<script>alert('您还未登录 请先登录')</script>";
			echo "<script>location.href='http://localhost/chuangwu/web/index.php?r=login/show'</script>";
		}

	}
}